home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 201-220 / scopedisk214 / skeleton / testclass.c < prev   
C/C++ Source or Header  |  1995-03-19  |  1KB  |  57 lines

  1. /*
  2.  * testclass - a stupidly simple progam to test the skeleton class
  3.  *
  4.  * Public Domain.
  5.  *
  6.  * Christian E. Hopps.
  7.  *
  8.  */
  9.  
  10. #include <skeleton.h>
  11. #include <proto/exec.h>
  12. #include <proto/utility.h>
  13. #include <proto/intuition.h>
  14.  
  15. struct Library *IntuitionBase = NULL;
  16. struct Library *UtilityBase = NULL;
  17.  
  18. void main(int argc, char **argv);
  19.  
  20. void main(int argc, char **argv)
  21. {
  22.     Class *SkeletonClass;
  23.     Object *skel_obj;
  24.  
  25.     if(!( IntuitionBase = OpenLibrary("intuition.library",36) )) {
  26.         return;
  27.     } else if(!( UtilityBase = OpenLibrary("utility.library",36) )) {
  28.         CloseLibrary(IntuitionBase);
  29.         return;
  30.     } else if(!( SkeletonClass = Skeleton_init() )) {
  31.         CloseLibrary(IntuitionBase);
  32.         CloseLibrary(UtilityBase);
  33.         return;
  34.     }
  35.     /*
  36.      * Everything opened ok, try and get an object.
  37.      */
  38.  
  39.     if( skel_obj = NewObject(SkeletonClass,NULL,TAG_DONE) ) {
  40.         /*
  41.          * Got it, now dispose of it.
  42.          */
  43.         Write(Output(),"skeleton class loaded, removing.\n",33);
  44.         DisposeObject(skel_obj);
  45.     } else {
  46.         /*
  47.          * Failed do a display beep.
  48.          */
  49.         DisplayBeep(NULL);
  50.     }
  51.  
  52.     Skeleton_free(SkeletonClass);
  53.     CloseLibrary(UtilityBase);
  54.     CloseLibrary(IntuitionBase);
  55.  
  56.     return;
  57. }